class base =
    object
        method a = 1
    end;;

class derived =
    object
        inherit base as super
    end;;

let num = ref 0;;

let rec loop i =
    let obj = new derived in
    num := !num + obj#a;
    if (i > 0) then
        loop (i - 1);;

loop 1000000;;

print_int !num;;
print_string "\n";;
